<!-- This comment will put IE 6, 7 and 8 in quirks mode -->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>FEUP-Defender: video-text/video-text.h Source File</title>
<link href="../../tabs.css" rel="stylesheet" type="text/css"/>
<link href="../../search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javaScript" src="../../search/search.js"></script>
<link href="../../doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body onload='searchBox.OnSelectItem(0);'>
<!-- Gerado por Doxygen 1.6.3 -->
<script type="text/javascript"><!--
var searchBox = new SearchBox("searchBox", "../../search",false,'Localizar');
--></script>
<script type="text/javascript">
<!--
function changeDisplayState (e){
  var num=this.id.replace(/[^[0-9]/g,'');
  var button=this.firstChild;
  var sectionDiv=document.getElementById('dynsection'+num);
  if (sectionDiv.style.display=='none'||sectionDiv.style.display==''){
    sectionDiv.style.display='block';
    button.src='../../open.gif';
  }else{
    sectionDiv.style.display='none';
    button.src='../../closed.gif';
  }
}
function initDynSections(){
  var divs=document.getElementsByTagName('div');
  var sectionCounter=1;
  for(var i=0;i<divs.length-1;i++){
    if(divs[i].className=='dynheader'&&divs[i+1].className=='dynsection'){
      var header=divs[i];
      var section=divs[i+1];
      var button=header.firstChild;
      if (button!='IMG'){
        divs[i].insertBefore(document.createTextNode(' '),divs[i].firstChild);
        button=document.createElement('img');
        divs[i].insertBefore(button,divs[i].firstChild);
      }
      header.style.cursor='pointer';
      header.onclick=changeDisplayState;
      header.id='dynheader'+sectionCounter;
      button.src='../../closed.gif';
      section.id='dynsection'+sectionCounter;
      section.style.display='none';
      section.style.marginLeft='14px';
      sectionCounter++;
    }
  }
}
window.onload = initDynSections;
-->
</script>
<div class="navigation" id="top">
  <div class="tabs">
    <ul>
      <li><a href="../../index.html"><span>Página&nbsp;principal</span></a></li>
      <li><a href="../../modules.html"><span>Módulos</span></a></li>
      <li><a href="../../annotated.html"><span>Estruturas&nbsp;de&nbsp;dados</span></a></li>
      <li class="current"><a href="../../files.html"><span>Ficheiros</span></a></li>
      <li><a href="../../dirs.html"><span>Directories</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <img id="MSearchSelect" src="../../search/search.png"
             onmouseover="return searchBox.OnSearchSelectShow()"
             onmouseout="return searchBox.OnSearchSelectHide()"
             alt=""/>
        <input type="text" id="MSearchField" value="Localizar" accesskey="S"
             onfocus="searchBox.OnSearchFieldFocus(true)" 
             onblur="searchBox.OnSearchFieldFocus(false)" 
             onkeyup="searchBox.OnSearchFieldChange(event)"/>
        <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="../../search/close.png" alt=""/></a>
        </div>
      </li>
    </ul>
  </div>
  <div class="tabs">
    <ul>
      <li><a href="../../files.html"><span>Lista&nbsp;de&nbsp;ficheiros</span></a></li>
      <li><a href="../../globals.html"><span>Globais</span></a></li>
    </ul>
  </div>
  <div class="navpath"><a class="el" href="../../dir_2ea2b06f96b5ff884113b2d485ad5809.html">video-text</a>
  </div>
</div>
<div class="contents">
<h1>video-text.h</h1><a href="../../d8/d1d/video-text_8h.html">Ir para a documentação deste ficheiro.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="preprocessor">#ifndef _VIDEO_TEXT_H_</span>
<a name="l00002"></a>00002 <span class="preprocessor"></span><span class="preprocessor">#define _VIDEO_TEXT_H_</span>
<a name="l00003"></a>00003 <span class="preprocessor"></span>
<a name="l00004"></a>00004 <span class="preprocessor">#include &lt;sys/farptr.h&gt;</span>         <span class="comment">//onde estao definidas as funcoes _farpokeb() e _farpeekb()</span>
<a name="l00005"></a>00005 <span class="preprocessor">#include &lt;go32.h&gt;</span>                       <span class="comment">//onde se encontra definido &#39;_dos_ds&#39;</span>
<a name="l00006"></a>00006 <span class="preprocessor">#include &quot;../utypes.h&quot;</span>
<a name="l00007"></a>00007 
<a name="l00016"></a><a class="code" href="../../d6/df8/group__VideoText.html#ga68707f77202e77a891e4f56e1f9b0219">00016</a> <span class="preprocessor">#define VIDEO_TEXT 0xB8000 ///&lt; Video address in text mode</span>
<a name="l00017"></a><a class="code" href="../../d6/df8/group__VideoText.html#ga241aeeb764887ae5e3de58b98f04b16d">00017</a> <span class="preprocessor"></span><span class="preprocessor">#define WIDTH 80           ///&lt; Number of columns</span>
<a name="l00018"></a><a class="code" href="../../d6/df8/group__VideoText.html#gaed89bd71aee8be823e8a20ec4e093c1e">00018</a> <span class="preprocessor"></span><span class="preprocessor">#define HEIGHT 25          ///&lt; Number of rows</span>
<a name="l00019"></a>00019 <span class="preprocessor"></span>
<a name="l00025"></a><a class="code" href="../../d6/df8/group__VideoText.html#gaf033cdad58c0882be7d5f4f6e8e51cc5">00025</a> <span class="preprocessor">#define BLUE_FOREG  (1 &lt;&lt; 0)  ///&lt; Foreground blue bit</span>
<a name="l00026"></a><a class="code" href="../../d6/df8/group__VideoText.html#ga6930edb189b477929f9860eb18f9eb28">00026</a> <span class="preprocessor"></span><span class="preprocessor">#define GREEN_FOREG (1 &lt;&lt; 1)  ///&lt; Foreground green bit</span>
<a name="l00027"></a><a class="code" href="../../d6/df8/group__VideoText.html#gafdb9aad619ebc55ef35dbca7d3d29f67">00027</a> <span class="preprocessor"></span><span class="preprocessor">#define RED_FOREG   (1 &lt;&lt; 2)  ///&lt; Foreground red bit</span>
<a name="l00028"></a>00028 <span class="preprocessor"></span>
<a name="l00029"></a><a class="code" href="../../d6/df8/group__VideoText.html#gaefba0529f534f0403d79db250c5e266f">00029</a> <span class="preprocessor">#define STRONG      (1 &lt;&lt; 3)  ///&lt; Foreground intensity bit</span>
<a name="l00030"></a>00030 <span class="preprocessor"></span>
<a name="l00031"></a><a class="code" href="../../d6/df8/group__VideoText.html#ga38779351433b604698f05e98c6c85f3c">00031</a> <span class="preprocessor">#define BLUE_BACK   (1 &lt;&lt; 4)  ///&lt; Background blue bit</span>
<a name="l00032"></a><a class="code" href="../../d6/df8/group__VideoText.html#ga8d30d8ed6e3aa0e1ed94a55d10098668">00032</a> <span class="preprocessor"></span><span class="preprocessor">#define GREEN_BACK  (1 &lt;&lt; 5)  ///&lt; Background gren bit</span>
<a name="l00033"></a><a class="code" href="../../d6/df8/group__VideoText.html#gaba6c0183ebb09921a6cbb31fd143310b">00033</a> <span class="preprocessor"></span><span class="preprocessor">#define RED_BACK    (1 &lt;&lt; 6)  ///&lt; Background red bit</span>
<a name="l00034"></a>00034 <span class="preprocessor"></span>
<a name="l00035"></a><a class="code" href="../../d6/df8/group__VideoText.html#gaa0852016db20e3d95e89c9cfe06d77e5">00035</a> <span class="preprocessor">#define AQUA_BACK               (BLUE_BACK | GREEN_BACK)</span>
<a name="l00036"></a><a class="code" href="../../d6/df8/group__VideoText.html#ga4276746c320d3e5290ef1ee3d3f5c83d">00036</a> <span class="preprocessor"></span><span class="preprocessor">#define PURPLE_BACK             (BLUE_BACK | RED_BACK)</span>
<a name="l00037"></a><a class="code" href="../../d6/df8/group__VideoText.html#ga1fd19b5b07308b98224e33d2b15ad168">00037</a> <span class="preprocessor"></span><span class="preprocessor">#define YELLOW_BACK             (GREEN_BACK | RED_BACK)</span>
<a name="l00038"></a><a class="code" href="../../d6/df8/group__VideoText.html#ga9432bc0e0317970ad6b3dea1555d9921">00038</a> <span class="preprocessor"></span><span class="preprocessor">#define LIGHTGRAY_BACK  (BLUE_BACK | GREEN_BACK | RED_BACK)</span>
<a name="l00039"></a>00039 <span class="preprocessor"></span>
<a name="l00040"></a>00040 <span class="comment">//#define BLINK       (1 &lt;&lt; 7)  ///&lt; already defined in conio.h</span>
<a name="l00041"></a>00041 
<a name="l00042"></a><a class="code" href="../../d6/df8/group__VideoText.html#ga1291f416b069313021b519eea62d5bf1">00042</a> <span class="preprocessor">#define NORMAL (RED_FOREG | GREEN_FOREG | BLUE_FOREG) ///&lt; handy definition</span>
<a name="l00043"></a>00043 <span class="preprocessor"></span>
<a name="l00047"></a>00047 
<a name="l00048"></a>00048 
<a name="l00051"></a>00051 <a class="code" href="../../d8/db9/group__UserTypes.html#ga718b4eb2652c286f4d42dc18a8e71a1a" title="ulong is an unsigned long">ulong</a> <a class="code" href="../../d6/df8/group__VideoText.html#ga5876c9f47ae08936a6634ecf22e09ea9">calcMemPosition</a>(<span class="keywordtype">int</span> x, <span class="keywordtype">int</span> y);
<a name="l00052"></a>00052 
<a name="l00053"></a>00053 <span class="comment">//get character at position x, y</span>
<a name="l00054"></a>00054 <span class="keywordtype">int</span> <a class="code" href="../../d6/df8/group__VideoText.html#gaf84d8188b4820f9535fcfe8d970e2838">getCharAt</a>(<span class="keywordtype">int</span> x, <span class="keywordtype">int</span> y);
<a name="l00055"></a>00055 
<a name="l00056"></a>00056 <span class="comment">//get attributes at position x, y</span>
<a name="l00057"></a>00057 <span class="keywordtype">int</span> <a class="code" href="../../d6/df8/group__VideoText.html#ga46332f39e1e5b8dd850f8e379f10ba1d">getAttributesAt</a>(<span class="keywordtype">int</span> x, <span class="keywordtype">int</span> y);
<a name="l00058"></a>00058 
<a name="l00062"></a>00062 <a class="code" href="../../d8/db9/group__UserTypes.html#ga39db6982619d623273fad8a383489309">Bool</a> <a class="code" href="../../d6/df8/group__VideoText.html#gaa57acc96a0a70498025a2027fba89536">printCharAt</a>(<span class="keywordtype">char</span> ch, <span class="keywordtype">int</span> x, <span class="keywordtype">int</span> y, <span class="keywordtype">char</span> attributes);
<a name="l00063"></a>00063 
<a name="l00064"></a>00064 <span class="comment">//print line</span>
<a name="l00065"></a>00065 <span class="keywordtype">void</span> <a class="code" href="../../d6/df8/group__VideoText.html#gae79b53b8b2666d7d50cb6b1b8b10e677">printLineAt</a>(<span class="keywordtype">char</span> ch, <span class="keywordtype">int</span> xi, <span class="keywordtype">int</span> yi, <span class="keywordtype">int</span> xf, <span class="keywordtype">int</span> yf, <span class="keywordtype">char</span> attributes);
<a name="l00066"></a>00066 
<a name="l00070"></a>00070 <a class="code" href="../../d8/db9/group__UserTypes.html#ga39db6982619d623273fad8a383489309">Bool</a> <a class="code" href="../../d6/df8/group__VideoText.html#ga0313826471a670c22f918e8f2321ed42">printStringAt</a>(<span class="keywordtype">char</span> *str, <span class="keywordtype">int</span> x, <span class="keywordtype">int</span> y, <span class="keywordtype">char</span> attributes);
<a name="l00071"></a>00071 
<a name="l00072"></a>00072 <span class="comment">/* print character array str at position x, y with attributes</span>
<a name="l00073"></a>00073 <span class="comment">if n_char &gt;= 0, it will print exactly n_char characters</span>
<a name="l00074"></a>00074 <span class="comment">returns the number of chars printed</span>
<a name="l00075"></a>00075 <span class="comment">*/</span>
<a name="l00076"></a>00076 <span class="keywordtype">int</span> <a class="code" href="../../d6/df8/group__VideoText.html#ga4cd78efdaa310697b6e14cdee164f400">printSizedStringAt</a>(<span class="keywordtype">char</span> *str, <span class="keywordtype">int</span> n_char, <span class="keywordtype">int</span> x, <span class="keywordtype">int</span> y, <span class="keywordtype">char</span> attributes);
<a name="l00077"></a>00077 
<a name="l00080"></a>00080 <span class="keywordtype">void</span> <a class="code" href="../../d6/df8/group__VideoText.html#ga5077f8c181f7342c6bb640c65b4977a2">fillScreen</a>(<span class="keywordtype">char</span> background);
<a name="l00081"></a>00081 
<a name="l00086"></a>00086 <a class="code" href="../../d8/db9/group__UserTypes.html#ga39db6982619d623273fad8a383489309">Bool</a> <a class="code" href="../../d6/df8/group__VideoText.html#ga6a34b0b18d5e443e272a66262d15bb1a">printIntAt</a>(<span class="keywordtype">int</span> num, <span class="keywordtype">int</span> x, <span class="keywordtype">int</span> y, <span class="keywordtype">char</span> attributes);
<a name="l00087"></a>00087 
<a name="l00092"></a>00092 <a class="code" href="../../d8/db9/group__UserTypes.html#ga39db6982619d623273fad8a383489309">Bool</a> <a class="code" href="../../d6/df8/group__VideoText.html#gaf265e000b8df8f8ef7fc11b782a7c0ed">drawFrame</a>(<span class="keywordtype">char</span> *title, <span class="keywordtype">char</span> attributes,
<a name="l00093"></a>00093         <span class="keywordtype">int</span> x, <span class="keywordtype">int</span> y, <span class="keywordtype">int</span> width, <span class="keywordtype">int</span> height);
<a name="l00094"></a>00094 
<a name="l00095"></a>00095 <span class="comment">//draw table with n_lin x n_col cells (1x1 size)</span>
<a name="l00096"></a>00096 <a class="code" href="../../d8/db9/group__UserTypes.html#ga39db6982619d623273fad8a383489309">Bool</a> <a class="code" href="../../d6/df8/group__VideoText.html#ga567e3669990f4c2f44549253c9bc0d6a">drawTable</a>(<span class="keywordtype">char</span> attributes, <span class="keywordtype">int</span> x, <span class="keywordtype">int</span> y, <span class="keywordtype">int</span> n_lin, <span class="keywordtype">int</span> n_col);
<a name="l00097"></a>00097 
<a name="l00098"></a>00098 
<a name="l00103"></a>00103 <span class="preprocessor">#endif</span>
<a name="l00104"></a>00104 <span class="preprocessor"></span>
</pre></div></div>
<!--- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&nbsp;</span>Tudo</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&nbsp;</span>Estruturas de dados</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&nbsp;</span>Ficheiros</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&nbsp;</span>Funções</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&nbsp;</span>Variáveis</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&nbsp;</span>Definições de tipos</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&nbsp;</span>Enumerações</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&nbsp;</span>Valores da enumeração</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark">&nbsp;</span>Macros</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<hr class="footer"/><address style="text-align: right;"><small>Gerado em Tue Jun 1 21:46:45 2010 para FEUP-Defender por&nbsp;
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="../../doxygen.png" alt="doxygen"/></a> 1.6.3 </small></address>
</body>
</html>
